home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / mgr / sparcmgr / demo3.zoo / demo / misc / grid.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-03-21  |  1.2 KB  |  67 lines

  1. /*                        Copyright (c) 1988 Bellcore
  2.  *                            All Rights Reserved
  3.  *       Permission is granted to copy or use this program, EXCEPT that it
  4.  *       may not be sold for profit, the copyright notice must be reproduced
  5.  *       on copies, and credit should be given to Bellcore where it is due.
  6.  *       BELLCORE MAKES NO WARRANTY AND ACCEPTS NO LIABILITY FOR THIS PROGRAM.
  7.  */
  8. /*    $Header: grid.c,v 4.2 88/05/31 13:22:40 bianchi Exp $
  9.     $Source: /tmp/mgrsrc/demo/misc/RCS/grid.c,v $
  10. */
  11. static char    RCSid_[] = "$Source: /tmp/mgrsrc/demo/misc/RCS/grid.c,v $$Revision: 4.2 $";
  12.  
  13. /*    grid.c  - draw a grid of lines */
  14.  
  15. #include "term.h"
  16. #include <signal.h>
  17.  
  18. static
  19. clean( i )
  20. int    i;
  21. {
  22.     m_pop();
  23.     exit(i);
  24. }
  25.  
  26.  
  27. main(argc,argv)
  28.     int argc;
  29.     char *argv[];
  30. {
  31.     int x,y,i,j;
  32.     int xmax,ymax,dummy;
  33.  
  34.     ckmgrterm( *argv );
  35.  
  36.     if (argc >= 2) {
  37.         x = atoi(argv[1]);
  38.         y = atoi(argv[2]);
  39.         }
  40.     else {
  41.         x = 10;
  42.         y = 10;
  43.         }
  44.  
  45.     if (x<2)
  46.         x = 10;
  47.  
  48.     if (y<2)
  49.         y = 10;
  50.  
  51.     m_setup(0);
  52.     get_size(&dummy,&dummy,&xmax,&ymax);
  53.     signal(SIGTERM,clean);
  54.     signal(SIGINT,clean);
  55.     signal(SIGHUP,clean);
  56.     m_clear();
  57.     m_push(P_FLAGS);
  58.     m_setmode(M_ABS);
  59.  
  60.     m_func(B_SET);
  61.     for(i=0;i<xmax;i+=x)
  62.         m_line(i,0,i,ymax);
  63.     for(i=0;i<ymax;i+=y)
  64.         m_line(0,i,xmax,i);
  65.     clean(0);
  66. }
  67.